2eb44fa9cf071cfdea8c621847094ede02e94280,processor/src/main/java/org/derive4j/processor/derivator/LazyConstructorDerivator.java,LazyConstructorDerivator,derive,#AlgebraicDataType#DeriveContext#DeriveUtils#,45

Before Change


                .addCode(CodeBlock.builder()
                    .addStatement("$T _evaluation = this.evaluation", typeName)
                    .beginControlFlow("if (_evaluation == null)")
                    .beginControlFlow("synchronized (this.lock)")
                    .addStatement("_evaluation = this.evaluation")
                    .beginControlFlow("if (_evaluation == null)")
                    .addStatement("this.evaluation = _evaluation = expression.$L()", Utils.getAbstractMethods(lazyTypeElement.getEnclosedElements()).get(0).getSimpleName())
                    .addStatement("this.expression = null")
                    .endControlFlow().endControlFlow().endControlFlow()
                    .addStatement("return _evaluation")
                    .build())
                .build())
        .addMethod(

After Change


                .addCode(CodeBlock.builder()
                    .beginControlFlow("if (!initialized)")
                    .beginControlFlow("synchronized (this)")
                    .beginControlFlow("if (!initialized)")
                    .addStatement("$T _evaluation = expression.$L()", typeName, Utils.getAbstractMethods(lazyTypeElement.getEnclosedElements()).get(0).getSimpleName())
                    .addStatement("evaluation = _evaluation")
                    .addStatement("initialized = true")
                    .addStatement("return _evaluation")
                    .endControlFlow().endControlFlow().endControlFlow()
                    .addStatement("return evaluation")
                    .build())
                .build())
        .addMethod(